snippet }
	{{ $1 }}
# =============== import ============================
snippet fr
	from ${1} import ${2}
snippet fr.
	from .${2} import ${1}
snippet fr.m
	from .models import *
snippet fr.forms
	from django	import forms
snippet fr.forms.m
	from django.forms import ModelForm
snippet fr.dj
	from django.${1} import ${2}
snippet fr.url
	from django.conf.urls import url
snippet fr.auth
	from django.contrib import auth
snippet fr.login
	from django.contrib.auth.views import login, logout
snippet fr.views
	from . import views
snippet fr.http
	from django.http import HttpResponse, HttpResponseRedirect
snippet fr.user
	from django.contrib.auth.models import User
snippet fr.generic
	from django.views import generic
# =============== class =========================

# New ListView Class
snippet cl.lv
	class ${1:name}View(generic.ListView):
		model = ${3:Model}
		template_name = '${4:$1}.html'
		context_object_name = '${5:$3}_list'

# New DetailView Class
snippet cl.dv
	class ${1:name}View(generic.DetailView):
		model = ${3:Model}
		template_name = '${4:$1}.html'
		context_object_name = '${5:$3}'

# New normal Class
snippet cl.
	class ${1:ModelName}(models.Model):
		${2:pass}

# New Model Class
snippet cl.m
	class ${1:ModelName}(models.Model):
		char${2:}

		def __str__(self):
			return self.${0}

# New Meta Class
snippet cl.M
	class Meta:
		ordering = ['${1:order}']

# New modelForm Class
snippet cl.fm.m
	class ${1:ModelName}Form(ModelForm):
		class Meta:
			model = ${2:$1}
			fields = ['$3',]

# =============== def views =========================
# New normal View
snippet def.n
	def ${1:viewName}(request):
		return HttpResponse('$2 $1')

# New template View
snippet def.t
	def ${1:viewName}(request):
		return render(request, '$1.html', locals())

# =============== url ============================
# New urls set
snippet ?P
	(?P<$1>$2)/
snippet url(r'^?P
	url(r'^(?P<$1>$2)/
snippet url.s
	urlpatterns = [
		url(r'^$1$', views.$2, name='$3'),
	]
snippet url.n
	url(r'^${1:index}$', views.${2:$1}, name='${3:$1}'),
snippet url.v
	url(r'^$1$', views.$2.as_view(), name='$3'),
snippet url.i
	url(r'^$1', include('$1.urls', namespace='$1')),
snippet url.pk.v
	url(r'^$1/(?P<pk>)$2/$', views.$3.as_views(), name='$4'),
snippet url.login
	url(r'^accounts/login/$', login),
snippet url.logout
	url(r'^accounts/logout/$', logout),
# =============== model ============================
snippet datef
	${1:FIELDNAME} = models.DateField(${2:auto_now_add=True, auto_now=True}${0:, blank=True, null=True})
snippet datetimef
	${1:FIELDNAME} = models.DateTimeField(${2:auto_now_add=True, auto_now=True}${0:, blank=True, null=True})

